// Copyright (c) Appeon. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. 
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

using System;
using System.Collections.Generic;

namespace SnapObjects.Data.Informix 
{
    public class InformixSqlCharacters : SqlCharacters
    {
        private static readonly IDictionary<string, SqlCharacters> _sqlmembers
            = new Dictionary<string, SqlCharacters>(
                _members, StringComparer.OrdinalIgnoreCase);

        protected InformixSqlCharacters(string name) : base(name)
        {

        }

        protected override void Register(string name)
        {
            if (!_sqlmembers.ContainsKey(name))
            {
                _sqlmembers.Add(name, this);
            }

            _name = name;
        }

        public static new bool IsCharacter(string value)
        {
            return _sqlmembers.ContainsKey(value);
        }

        public static new SqlCharacters Parse(string value)
        {
            if (_sqlmembers.ContainsKey(value))
            {
                return _sqlmembers[value];
            }

            return NOTHING;
        }
    }
}
